using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AssetFrame.Message;
using System.Reflection;
using System.Data;
using MySql.Data.MySqlClient;
using SysFrame.BP;
using SysFrame.Message;

namespace AssetFrame.BP
{
    /// <summary>
    /// asset_a1方法
    /// </summary>
    public class MySQLasset_a1 : Iasset_a1
    {

        /// <summary>
        /// 得到asset_a1实体
        /// </summary>
        /// <param name="msq">条件</param>
        /// <returns></returns>
        public List<Msasset_a1> Getasset_a1MsByQuery(MsQuery msq)
        {
            List<Msasset_a1> listms = new List<Msasset_a1>();
            StringBuilder sb = new StringBuilder();
            List<string> lstCmdText = new List<string>();
            sb.Append("select asset_a1.* ");
            sb.Append(" from asset_a1 ");
            sb.Append(" where 1=1 ").Append(msq.strquery);
            if (msq.strorder != null && msq.strorder != "")
            {
                sb.Append(" order by ").Append(msq.strorder);
            }
            lstCmdText.Add(sb.ToString());
            sb.Remove(0, sb.ToString().Length);
            try
            {
                DataSet ds = DbHelperMySQL.Query(lstCmdText[0].ToString());
                if (ds != null && ds.Tables.Count != 0 && ds.Tables[0].Rows.Count != 0)
                {
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        Msasset_a1 ms = new Msasset_a1();
                        if (dr["ASSET_A1_AUTOID"].ToString() != "") { ms.ASSET_A1_AUTOID = int.Parse(dr["ASSET_A1_AUTOID"].ToString()); }
                        if (dr["ASSET_A1_ISDEL"] != null) { ms.ASSET_A1_ISDEL = dr["ASSET_A1_ISDEL"].ToString(); }
                        if (dr["ASSET_A1_MAKETIME"] != null) { ms.ASSET_A1_MAKETIME = dr["ASSET_A1_MAKETIME"].ToString(); }
                        if (dr["ASSET_A1_MAKEUSER"] != null) { ms.ASSET_A1_MAKEUSER = dr["ASSET_A1_MAKEUSER"].ToString(); }
                        if (dr["ASSET_A1_PARENTID"] != null) { ms.ASSET_A1_PARENTID = dr["ASSET_A1_PARENTID"].ToString(); }
                        if (dr["ASSET_A1_MAKEFROM"] != null) { ms.ASSET_A1_MAKEFROM = dr["ASSET_A1_MAKEFROM"].ToString(); }
                        if (dr["ASSET_A1_10"] != null && dr["ASSET_A1_10"].ToString() != "") { ms.ASSET_A1_10 = int.Parse(dr["ASSET_A1_10"].ToString()); }
                        if (dr["ASSET_A1_20"] != null) { ms.ASSET_A1_20 = dr["ASSET_A1_20"].ToString(); }
                        if (dr["ASSET_A1_30"] != null) { ms.ASSET_A1_30 = dr["ASSET_A1_30"].ToString(); }
                        if (dr["ASSET_A1_40"] != null) { ms.ASSET_A1_40 = dr["ASSET_A1_40"].ToString(); }
                        if (dr["ASSET_A1_50"] != null) { ms.ASSET_A1_50 = dr["ASSET_A1_50"].ToString(); }
                        if (dr["ASSET_A1_60"] != null && dr["ASSET_A1_60"].ToString() != "") { ms.ASSET_A1_60 = int.Parse(dr["ASSET_A1_60"].ToString()); }
                        if (dr["ASSET_A1_70"] != null) { ms.ASSET_A1_70 = dr["ASSET_A1_70"].ToString(); }
                        if (dr["ASSET_A1_80"] != null) { ms.ASSET_A1_80 = dr["ASSET_A1_80"].ToString(); }
                        if (dr["ASSET_A1_90"] != null) { ms.ASSET_A1_90 = dr["ASSET_A1_90"].ToString(); }
                        if (dr["ASSET_A1_100"] != null && dr["ASSET_A1_100"].ToString() != "") { ms.ASSET_A1_100 = int.Parse(dr["ASSET_A1_100"].ToString()); }
                        if (dr["ASSET_A1_110"] != null) { ms.ASSET_A1_110 = dr["ASSET_A1_110"].ToString(); }
                        if (dr["ASSET_A1_120"] != null) { ms.ASSET_A1_120 = dr["ASSET_A1_120"].ToString(); }
                        if (dr["ASSET_A1_130"] != null) { ms.ASSET_A1_130 = dr["ASSET_A1_130"].ToString(); }
                        if (dr["ASSET_A1_140"] != null && dr["ASSET_A1_140"].ToString() != "") { ms.ASSET_A1_140 = int.Parse(dr["ASSET_A1_140"].ToString()); }
                        if (dr["ASSET_A1_150"] != null) { ms.ASSET_A1_150 = dr["ASSET_A1_150"].ToString(); }
                        if (dr["ASSET_A1_160"] != null && dr["ASSET_A1_160"].ToString() != "") { ms.ASSET_A1_160 = int.Parse(dr["ASSET_A1_160"].ToString()); }
                        if (dr["ASSET_A1_170"] != null) { ms.ASSET_A1_170 = dr["ASSET_A1_170"].ToString(); }
                        if (dr["ASSET_A1_180"] != null && dr["ASSET_A1_180"].ToString() != "") { ms.ASSET_A1_180 = int.Parse(dr["ASSET_A1_180"].ToString()); }
                        if (dr["ASSET_A1_190"] != null) { ms.ASSET_A1_190 = dr["ASSET_A1_190"].ToString(); }
                        if (dr["ASSET_A1_200"] != null && dr["ASSET_A1_200"].ToString() != "") { ms.ASSET_A1_200 = int.Parse(dr["ASSET_A1_200"].ToString()); }
                        if (dr["ASSET_A1_210"] != null) { ms.ASSET_A1_210 = dr["ASSET_A1_210"].ToString(); }
                        if (dr["ASSET_A1_220"] != null && dr["ASSET_A1_220"].ToString() != "") { ms.ASSET_A1_220 = int.Parse(dr["ASSET_A1_220"].ToString()); }
                        if (dr["ASSET_A1_230"] != null) { ms.ASSET_A1_230 = dr["ASSET_A1_230"].ToString(); }
                        if (dr["ASSET_A1_240"] != null && dr["ASSET_A1_240"].ToString() != "") { ms.ASSET_A1_240 = int.Parse(dr["ASSET_A1_240"].ToString()); }
                        if (dr["ASSET_A1_250"] != null && dr["ASSET_A1_250"].ToString() != "") { ms.ASSET_A1_250 = int.Parse(dr["ASSET_A1_250"].ToString()); }
                        if (dr["ASSET_A1_260"] != null) { ms.ASSET_A1_260 = dr["ASSET_A1_260"].ToString(); }
                        if (dr["ASSET_A1_270"] != null) { ms.ASSET_A1_270 = dr["ASSET_A1_270"].ToString(); }
                        if (dr["ASSET_A1_280"] != null) { ms.ASSET_A1_280 = dr["ASSET_A1_280"].ToString(); }
                        if (dr["ASSET_A1_290"] != null) { ms.ASSET_A1_290 = dr["ASSET_A1_290"].ToString(); }
                        if (dr["ASSET_A1_300"] != null) { ms.ASSET_A1_300 = dr["ASSET_A1_300"].ToString(); }
                        if (dr["ASSET_A1_310"] != null) { ms.ASSET_A1_310 = dr["ASSET_A1_310"].ToString(); }
                        if (dr["ASSET_A1_320"] != null) { ms.ASSET_A1_320 = dr["ASSET_A1_320"].ToString(); }
                        if (dr["ASSET_A1_330"] != null) { ms.ASSET_A1_330 = dr["ASSET_A1_330"].ToString(); }
                        if (dr["ASSET_A1_340"] != null) { ms.ASSET_A1_340 = dr["ASSET_A1_340"].ToString(); }
                        if (dr["ASSET_A1_350"] != null) { ms.ASSET_A1_350 = dr["ASSET_A1_350"].ToString(); }
                        if (dr["ASSET_A1_360"] != null) { ms.ASSET_A1_360 = dr["ASSET_A1_360"].ToString(); }
                        if (dr["ASSET_A1_370"] != null) { ms.ASSET_A1_370 = dr["ASSET_A1_370"].ToString(); }
                        if (dr["ASSET_A1_380"] != null) { ms.ASSET_A1_380 = dr["ASSET_A1_380"].ToString(); }
                        if (dr["ASSET_A1_390"] != null) { ms.ASSET_A1_390 = dr["ASSET_A1_390"].ToString(); }
                        if (dr["ASSET_A1_400"] != null) { ms.ASSET_A1_400 = dr["ASSET_A1_400"].ToString(); }
                        if (dr["ASSET_A1_410"] != null) { ms.ASSET_A1_410 = dr["ASSET_A1_410"].ToString(); }
                        if (dr["ASSET_A1_420"] != null) { ms.ASSET_A1_420 = dr["ASSET_A1_420"].ToString(); }
                        if (dr["ASSET_A1_430"] != null) { ms.ASSET_A1_430 = dr["ASSET_A1_430"].ToString(); }
                        if (dr["ASSET_A1_440"] != null) { ms.ASSET_A1_440 = dr["ASSET_A1_440"].ToString(); }
                        if (dr["ASSET_A1_450"] != null) { ms.ASSET_A1_450 = dr["ASSET_A1_450"].ToString(); }
                        if (dr["ASSET_A1_460"] != null) { ms.ASSET_A1_460 = dr["ASSET_A1_460"].ToString(); }
                        if (dr["ASSET_A1_470"] != null) { ms.ASSET_A1_470 = dr["ASSET_A1_470"].ToString(); }
                        if (dr["ASSET_A1_480"] != null) { ms.ASSET_A1_480 = dr["ASSET_A1_480"].ToString(); }
                        if (dr["ASSET_A1_490"] != null) { ms.ASSET_A1_490 = dr["ASSET_A1_490"].ToString(); }
                        if (dr["ASSET_A1_500"] != null) { ms.ASSET_A1_500 = dr["ASSET_A1_500"].ToString(); }
                        if (dr["ASSET_A1_510"] != null) { ms.ASSET_A1_510 = dr["ASSET_A1_510"].ToString(); }
                        if (dr["ASSET_A1_520"] != null) { ms.ASSET_A1_520 = dr["ASSET_A1_520"].ToString(); }
                        if (dr["ASSET_A1_530"] != null) { ms.ASSET_A1_530 = dr["ASSET_A1_530"].ToString(); }
                        if (dr["ASSET_A1_540"] != null) { ms.ASSET_A1_540 = dr["ASSET_A1_540"].ToString(); }
                        if (dr["ASSET_A1_550"] != null) { ms.ASSET_A1_550 = dr["ASSET_A1_550"].ToString(); }
                        if (dr["ASSET_A1_560"] != null) { ms.ASSET_A1_560 = dr["ASSET_A1_560"].ToString(); }
                        if (dr["ASSET_A1_570"] != null) { ms.ASSET_A1_570 = dr["ASSET_A1_570"].ToString(); }
                        if (dr["ASSET_A1_580"] != null) { ms.ASSET_A1_580 = dr["ASSET_A1_580"].ToString(); }
                        if (dr["ASSET_A1_590"] != null) { ms.ASSET_A1_590 = dr["ASSET_A1_590"].ToString(); }
                        if (dr["ASSET_A1_600"] != null) { ms.ASSET_A1_600 = dr["ASSET_A1_600"].ToString(); }
                        if (dr["ASSET_A1_610"] != null) { ms.ASSET_A1_610 = dr["ASSET_A1_610"].ToString(); }
                        if (dr["ASSET_A1_620"] != null) { ms.ASSET_A1_620 = dr["ASSET_A1_620"].ToString(); }
                        if (dr["ASSET_A1_630"] != null) { ms.ASSET_A1_630 = dr["ASSET_A1_630"].ToString(); }
                        if (dr["ASSET_A1_640"] != null) { ms.ASSET_A1_640 = dr["ASSET_A1_640"].ToString(); }
                        if (dr["ASSET_A1_650"] != null) { ms.ASSET_A1_650 = dr["ASSET_A1_650"].ToString(); }
                        if (dr["ASSET_A1_660"] != null) { ms.ASSET_A1_660 = dr["ASSET_A1_660"].ToString(); }
                        if (dr["ASSET_A1_670"] != null) { ms.ASSET_A1_670 = dr["ASSET_A1_670"].ToString(); }
                        if (dr["ASSET_A1_680"] != null) { ms.ASSET_A1_680 = dr["ASSET_A1_680"].ToString(); }
                        if (dr["ASSET_A1_690"] != null) { ms.ASSET_A1_690 = dr["ASSET_A1_690"].ToString(); }
                        if (dr["ASSET_A1_700"] != null) { ms.ASSET_A1_700 = dr["ASSET_A1_700"].ToString(); }
                        if (dr["ASSET_A1_710"] != null) { ms.ASSET_A1_710 = dr["ASSET_A1_710"].ToString(); }
                        if (dr["ASSET_A1_720"] != null) { ms.ASSET_A1_720 = dr["ASSET_A1_720"].ToString(); }
                        if (dr["ASSET_A1_730"] != null) { ms.ASSET_A1_730 = dr["ASSET_A1_730"].ToString(); }
                        if (dr["ASSET_A1_740"] != null) { ms.ASSET_A1_740 = dr["ASSET_A1_740"].ToString(); }
                        if (dr["ASSET_A1_750"] != null) { ms.ASSET_A1_750 = dr["ASSET_A1_750"].ToString(); }
                        if (dr["ASSET_A1_760"] != null) { ms.ASSET_A1_760 = dr["ASSET_A1_760"].ToString(); }
                        if (dr["ASSET_A1_770"] != null) { ms.ASSET_A1_770 = dr["ASSET_A1_770"].ToString(); }
                        if (dr["ASSET_A1_780"] != null) { ms.ASSET_A1_780 = dr["ASSET_A1_780"].ToString(); }
                        if (dr["ASSET_A1_790"] != null) { ms.ASSET_A1_790 = dr["ASSET_A1_790"].ToString(); }
                        if (dr["ASSET_A1_800"] != null) { ms.ASSET_A1_800 = dr["ASSET_A1_800"].ToString(); }
                        listms.Add(ms);
                    }
                }
            }
            catch (Exception e) { }
            return listms;
        }

        /// <summary>
        /// 得到数据类型
        /// </summary>
        /// <param name="msquery">条件</param>
        /// <returns>数据类型</returns>
        public DataTable Getasset_a1DataByQuery(MsQuery msq)
        {
            DataTable dt = new DataTable();
            StringBuilder sbclo = new StringBuilder();
            StringBuilder sbtab = new StringBuilder();
            StringBuilder sbwhere = new StringBuilder();
            List<Mssys_asset_a1> listsys = new List<Mssys_asset_a1>();
            MsQuery msqsys = new MsQuery();
            msqsys.strquery += " and SYS_ASSET_A1_40='1' ";//是否有效
            msqsys.LoginUser = msq.LoginUser;
            listsys = new BLLsys_asset_a1().Getsys_asset_a1MsByQuery(msqsys);
            sbclo.Append(" select a1.ASSET_A1_AUTOID");
            sbtab.Append(" from Asset_A1 a1 ");
            sbwhere.Append(" where 1=1 ");
            foreach (var item in listsys)
            {
                sbclo.Append(",a1." + item.SYS_ASSET_A1_160);
                if (item.SYS_ASSET_A1_60 != "" && item.SYS_ASSET_A1_70 != "" && item.SYS_ASSET_A1_80 != "")
                {
                    string tabname = item.SYS_ASSET_A1_60 + item.AUTOID;
                    sbtab.Append(" LEFT JOIN " + item.SYS_ASSET_A1_60 + " " + tabname);
                    sbtab.Append(" on a1." + item.SYS_ASSET_A1_160 + "=" + tabname + "." + item.SYS_ASSET_A1_70);
                    if (item.SYS_ASSET_A1_90 != "")
                    {
                        sbtab.Append(" AND " + item.SYS_ASSET_A1_90.Replace("$tab$", tabname));
                    }
                    sbclo.Append("," + tabname + "." + item.SYS_ASSET_A1_80 + " str" + item.SYS_ASSET_A1_160);
                    foreach (var tabcol in item.SYS_ASSET_A1_100.Split(','))
                    {
                        if (tabcol != "")
                        {
                            sbclo.Append("," + tabname + "." + tabcol + " str" + item.SYS_ASSET_A1_160 + tabcol);
                        }
                    }
                }
            }
            string sql = sbclo.ToString() + sbtab.ToString() + sbwhere.ToString() + msq.strquery;
            DataSet ds = DbHelperMySQL.Query(sql);
            if (ds != null)
            {
                dt = ds.Tables[0];
            }
            return dt;
        }

        public DataTable Getasset_a1GroupDataByQuery(MsQuery msq, List<string> Groupfield)
        {
            DataTable dt = new DataTable();
            StringBuilder sbclo = new StringBuilder();
            StringBuilder sbtab = new StringBuilder();
            StringBuilder sbgroup = new StringBuilder();
            StringBuilder sbwhere = new StringBuilder();
            List<Mssys_asset_a1> listsys = new List<Mssys_asset_a1>();
            MsQuery msqsys = new MsQuery();
            msqsys.strquery += " and SYS_ASSET_A1_40='1' ";//是否有效
            msqsys.LoginUser = msq.LoginUser;
            listsys = new BLLsys_asset_a1().Getsys_asset_a1MsByQuery(msqsys);
            if (!string.IsNullOrEmpty(msq.strselect))
            {
                sbclo.Append(" select " + msq.strselect + " as value ");
            }
            else
            {
                sbclo.Append(" select count(a1.ASSET_A1_AUTOID) as value ");
            }
            sbtab.Append(" from Asset_A1 a1 ");
            sbgroup.Append(" GROUP BY  ");
            sbwhere.Append(" where 1=1 ");
            foreach (var item in listsys)
            {
                if (Groupfield.Contains(item.SYS_ASSET_A1_160))
                {
                    sbclo.Append(",a1." + item.SYS_ASSET_A1_160);
                    if (item.SYS_ASSET_A1_60 != "" && item.SYS_ASSET_A1_70 != "" && item.SYS_ASSET_A1_80 != "")
                    {
                        string tabname = item.SYS_ASSET_A1_60 + item.AUTOID;
                        sbtab.Append(" LEFT JOIN " + item.SYS_ASSET_A1_60 + " " + tabname);
                        sbtab.Append(" on a1." + item.SYS_ASSET_A1_160 + "=" + tabname + "." + item.SYS_ASSET_A1_70);
                        if (item.SYS_ASSET_A1_90 != "")
                        {
                            sbtab.Append(" AND " + item.SYS_ASSET_A1_90.Replace("$tab$", tabname));
                        }
                        sbclo.Append("," + tabname + "." + item.SYS_ASSET_A1_80 + " str" + item.SYS_ASSET_A1_160);
                        foreach (var tabcol in item.SYS_ASSET_A1_100.Split(','))
                        {
                            if (tabcol != "")
                            {
                                sbclo.Append("," + tabname + "." + tabcol + " str" + item.SYS_ASSET_A1_160 + tabcol);
                            }
                        }
                    }
                }
            }
            sbgroup.Append(string.Join(",", Groupfield));
            string sql = sbclo.ToString() + sbtab.ToString() + sbwhere.ToString() + msq.strquery + sbgroup;
            DataSet ds = DbHelperMySQL.Query(sql);
            if (ds != null)
            {
                dt = ds.Tables[0];
            }
            return dt;
        }
        /// <summary>
        ///  保存asset_a1信息
        /// </summary>
        /// <param name="ms">实体信息 通过ASSET_A1_AUTOID进行判断有ASSET_A1_AUTOID就是update</param>
        /// <returns>消息</returns>
        public MsReturned Saveasset_a1(Msasset_a1 ms)
        {
            MsReturned msr = new MsReturned();
            if (ms.ASSET_A1_AUTOID != null && ms.ASSET_A1_AUTOID.ToString() != "" && ms.ASSET_A1_AUTOID.ToString() != "0")
            {
                msr = Upasset_a1(ms);
            }
            else
            {
                msr = Addasset_a1(ms);
            }
            return msr;
        }

        /// <summary>
        ///  新增asset_a1信息
        /// </summary>
        /// <param name="ms">实体信息 通过ASSET_A1_AUTOID进行判断有ASSET_A1_AUTOID就是update</param>
        /// <returns>消息</returns>
        public MsReturned Addasset_a1(Msasset_a1 ms)
        {
            List<string> lstResult = new List<string>();
            StringBuilder sb = new StringBuilder();
            List<string> lstCmdText = new List<string>();
            MsReturned msr = new MsReturned();
            int newRateId = DataBase.GetMaxId("asset_a1", "ASSET_A1_AUTOID");
            sb.Append("insert into asset_a1 (");
            sb.Append("ASSET_A1_AUTOID,ASSET_A1_ISDEL,ASSET_A1_MAKETIME,ASSET_A1_MAKEUSER,ASSET_A1_PARENTID,");
            sb.Append("ASSET_A1_MAKEFROM,ASSET_A1_10,ASSET_A1_20,ASSET_A1_30,ASSET_A1_40,");
            sb.Append("ASSET_A1_50,ASSET_A1_60,ASSET_A1_70,ASSET_A1_80,ASSET_A1_90,");
            sb.Append("ASSET_A1_100,ASSET_A1_110,ASSET_A1_120,ASSET_A1_130,ASSET_A1_140,");
            sb.Append("ASSET_A1_150,ASSET_A1_160,ASSET_A1_170,ASSET_A1_180,ASSET_A1_190,");
            sb.Append("ASSET_A1_200,ASSET_A1_210,ASSET_A1_220,ASSET_A1_230,ASSET_A1_240,");
            sb.Append("ASSET_A1_250,ASSET_A1_260,ASSET_A1_270,ASSET_A1_280,ASSET_A1_290,");
            sb.Append("ASSET_A1_300,ASSET_A1_310,ASSET_A1_320,ASSET_A1_330,ASSET_A1_340,");
            sb.Append("ASSET_A1_350,ASSET_A1_360,ASSET_A1_370,ASSET_A1_380,ASSET_A1_390,");
            sb.Append("ASSET_A1_400,ASSET_A1_410,ASSET_A1_420,ASSET_A1_430,ASSET_A1_440,");
            sb.Append("ASSET_A1_450,ASSET_A1_460,ASSET_A1_470,ASSET_A1_480,ASSET_A1_490,");
            sb.Append("ASSET_A1_500,ASSET_A1_510,ASSET_A1_520,ASSET_A1_530,ASSET_A1_540,");
            sb.Append("ASSET_A1_550,ASSET_A1_560,ASSET_A1_570,ASSET_A1_580,ASSET_A1_590,");
            sb.Append("ASSET_A1_600,ASSET_A1_610,ASSET_A1_620,ASSET_A1_630,ASSET_A1_640,");
            sb.Append("ASSET_A1_650,ASSET_A1_660,ASSET_A1_670,ASSET_A1_680,ASSET_A1_690,");
            sb.Append("ASSET_A1_700,ASSET_A1_710,ASSET_A1_720,ASSET_A1_730,ASSET_A1_740,");
            sb.Append("ASSET_A1_750,ASSET_A1_760,ASSET_A1_770,ASSET_A1_780,ASSET_A1_790,");
            sb.Append("ASSET_A1_800");
            sb.Append(")");
            sb.Append("values ( ");
            sb.Append(newRateId.ToString()).Append(",");
            sb.Append("@ASSET_A1_ISDEL,@ASSET_A1_MAKETIME,@ASSET_A1_MAKEUSER,@ASSET_A1_PARENTID,");
            sb.Append("@ASSET_A1_MAKEFROM,@ASSET_A1_10,@ASSET_A1_20,@ASSET_A1_30,@ASSET_A1_40,");
            sb.Append("@ASSET_A1_50,@ASSET_A1_60,@ASSET_A1_70,@ASSET_A1_80,@ASSET_A1_90,");
            sb.Append("@ASSET_A1_100,@ASSET_A1_110,@ASSET_A1_120,@ASSET_A1_130,@ASSET_A1_140,");
            sb.Append("@ASSET_A1_150,@ASSET_A1_160,@ASSET_A1_170,@ASSET_A1_180,@ASSET_A1_190,");
            sb.Append("@ASSET_A1_200,@ASSET_A1_210,@ASSET_A1_220,@ASSET_A1_230,@ASSET_A1_240,");
            sb.Append("@ASSET_A1_250,@ASSET_A1_260,@ASSET_A1_270,@ASSET_A1_280,@ASSET_A1_290,");
            sb.Append("@ASSET_A1_300,@ASSET_A1_310,@ASSET_A1_320,@ASSET_A1_330,@ASSET_A1_340,");
            sb.Append("@ASSET_A1_350,@ASSET_A1_360,@ASSET_A1_370,@ASSET_A1_380,@ASSET_A1_390,");
            sb.Append("@ASSET_A1_400,@ASSET_A1_410,@ASSET_A1_420,@ASSET_A1_430,@ASSET_A1_440,");
            sb.Append("@ASSET_A1_450,@ASSET_A1_460,@ASSET_A1_470,@ASSET_A1_480,@ASSET_A1_490,");
            sb.Append("@ASSET_A1_500,@ASSET_A1_510,@ASSET_A1_520,@ASSET_A1_530,@ASSET_A1_540,");
            sb.Append("@ASSET_A1_550,@ASSET_A1_560,@ASSET_A1_570,@ASSET_A1_580,@ASSET_A1_590,");
            sb.Append("@ASSET_A1_600,@ASSET_A1_610,@ASSET_A1_620,@ASSET_A1_630,@ASSET_A1_640,");
            sb.Append("@ASSET_A1_650,@ASSET_A1_660,@ASSET_A1_670,@ASSET_A1_680,@ASSET_A1_690,");
            sb.Append("@ASSET_A1_700,@ASSET_A1_710,@ASSET_A1_720,@ASSET_A1_730,@ASSET_A1_740,");
            sb.Append("@ASSET_A1_750,@ASSET_A1_760,@ASSET_A1_770,@ASSET_A1_780,@ASSET_A1_790,");
            sb.Append("@ASSET_A1_800)");
            MySqlParameter[] parameters = {
                    new MySqlParameter("@ASSET_A1_AUTOID", MySqlDbType.Int32,11),
                    new MySqlParameter("@ASSET_A1_ISDEL", MySqlDbType.VarChar,1),
                    new MySqlParameter("@ASSET_A1_MAKETIME", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_MAKEUSER", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_PARENTID", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_MAKEFROM", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_10", MySqlDbType.Int32,11),
                    new MySqlParameter("@ASSET_A1_20", MySqlDbType.VarChar,500),
                    new MySqlParameter("@ASSET_A1_30", MySqlDbType.VarChar,500),
                    new MySqlParameter("@ASSET_A1_40", MySqlDbType.VarChar,500),
                    new MySqlParameter("@ASSET_A1_50", MySqlDbType.VarChar,500),
                    new MySqlParameter("@ASSET_A1_60", MySqlDbType.Int32,11),
                    new MySqlParameter("@ASSET_A1_70", MySqlDbType.VarChar,1),
                    new MySqlParameter("@ASSET_A1_80", MySqlDbType.VarChar,20),
                    new MySqlParameter("@ASSET_A1_90", MySqlDbType.VarChar,20),
                    new MySqlParameter("@ASSET_A1_100", MySqlDbType.Int32,11),
                    new MySqlParameter("@ASSET_A1_110", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_120", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_130", MySqlDbType.VarChar,500),
                    new MySqlParameter("@ASSET_A1_140", MySqlDbType.Int32,11),
                    new MySqlParameter("@ASSET_A1_150", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_160", MySqlDbType.Int32,11),
                    new MySqlParameter("@ASSET_A1_170", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_180", MySqlDbType.Int32,11),
                    new MySqlParameter("@ASSET_A1_190", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_200", MySqlDbType.Int32,11),
                    new MySqlParameter("@ASSET_A1_210", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_220", MySqlDbType.Int32,11),
                    new MySqlParameter("@ASSET_A1_230", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_240", MySqlDbType.Int32,11),
                    new MySqlParameter("@ASSET_A1_250", MySqlDbType.Int32,11),
                    new MySqlParameter("@ASSET_A1_260", MySqlDbType.VarChar,1),
                    new MySqlParameter("@ASSET_A1_270", MySqlDbType.VarChar,1),
                    new MySqlParameter("@ASSET_A1_280", MySqlDbType.VarChar,20),
                    new MySqlParameter("@ASSET_A1_290", MySqlDbType.VarChar,20),
                    new MySqlParameter("@ASSET_A1_300", MySqlDbType.VarChar,20),
                    new MySqlParameter("@ASSET_A1_310", MySqlDbType.VarChar,20),
                    new MySqlParameter("@ASSET_A1_320", MySqlDbType.VarChar,20),
                    new MySqlParameter("@ASSET_A1_330", MySqlDbType.VarChar,20),
                    new MySqlParameter("@ASSET_A1_340", MySqlDbType.VarChar,20),
                    new MySqlParameter("@ASSET_A1_350", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_360", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_370", MySqlDbType.VarChar,20),
                    new MySqlParameter("@ASSET_A1_380", MySqlDbType.VarChar,20),
                    new MySqlParameter("@ASSET_A1_390", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_400", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_410", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_420", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_430", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_440", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_450", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_460", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_470", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_480", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_490", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_500", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_510", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_520", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_530", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_540", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_550", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_560", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_570", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_580", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_590", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_600", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_610", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_620", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_630", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_640", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_650", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_660", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_670", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_680", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_690", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_700", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_710", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_720", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_730", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_740", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_750", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_760", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_770", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_780", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_790", MySqlDbType.VarChar,100),
                    new MySqlParameter("@ASSET_A1_800", MySqlDbType.VarChar,100)};
            parameters[0].Value = ms.ASSET_A1_AUTOID;
            parameters[1].Value = ms.ASSET_A1_ISDEL;
            parameters[2].Value = ms.ASSET_A1_MAKETIME;
            parameters[3].Value = ms.ASSET_A1_MAKEUSER;
            parameters[4].Value = ms.ASSET_A1_PARENTID;
            parameters[5].Value = ms.ASSET_A1_MAKEFROM;
            parameters[6].Value = ms.ASSET_A1_10;
            parameters[7].Value = ms.ASSET_A1_20;
            parameters[8].Value = ms.ASSET_A1_30;
            parameters[9].Value = ms.ASSET_A1_40;
            parameters[10].Value = ms.ASSET_A1_50;
            parameters[11].Value = ms.ASSET_A1_60;
            parameters[12].Value = ms.ASSET_A1_70;
            parameters[13].Value = ms.ASSET_A1_80;
            parameters[14].Value = ms.ASSET_A1_90;
            parameters[15].Value = ms.ASSET_A1_100;
            parameters[16].Value = ms.ASSET_A1_110;
            parameters[17].Value = ms.ASSET_A1_120;
            parameters[18].Value = ms.ASSET_A1_130;
            parameters[19].Value = ms.ASSET_A1_140;
            parameters[20].Value = ms.ASSET_A1_150;
            parameters[21].Value = ms.ASSET_A1_160;
            parameters[22].Value = ms.ASSET_A1_170;
            parameters[23].Value = ms.ASSET_A1_180;
            parameters[24].Value = ms.ASSET_A1_190;
            parameters[25].Value = ms.ASSET_A1_200;
            parameters[26].Value = ms.ASSET_A1_210;
            parameters[27].Value = ms.ASSET_A1_220;
            parameters[28].Value = ms.ASSET_A1_230;
            parameters[29].Value = ms.ASSET_A1_240;
            parameters[30].Value = ms.ASSET_A1_250;
            parameters[31].Value = ms.ASSET_A1_260;
            parameters[32].Value = ms.ASSET_A1_270;
            parameters[33].Value = ms.ASSET_A1_280;
            parameters[34].Value = ms.ASSET_A1_290;
            parameters[35].Value = ms.ASSET_A1_300;
            parameters[36].Value = ms.ASSET_A1_310;
            parameters[37].Value = ms.ASSET_A1_320;
            parameters[38].Value = ms.ASSET_A1_330;
            parameters[39].Value = ms.ASSET_A1_340;
            parameters[40].Value = ms.ASSET_A1_350;
            parameters[41].Value = ms.ASSET_A1_360;
            parameters[42].Value = ms.ASSET_A1_370;
            parameters[43].Value = ms.ASSET_A1_380;
            parameters[44].Value = ms.ASSET_A1_390;
            parameters[45].Value = ms.ASSET_A1_400;
            parameters[46].Value = ms.ASSET_A1_410;
            parameters[47].Value = ms.ASSET_A1_420;
            parameters[48].Value = ms.ASSET_A1_430;
            parameters[49].Value = ms.ASSET_A1_440;
            parameters[50].Value = ms.ASSET_A1_450;
            parameters[51].Value = ms.ASSET_A1_460;
            parameters[52].Value = ms.ASSET_A1_470;
            parameters[53].Value = ms.ASSET_A1_480;
            parameters[54].Value = ms.ASSET_A1_490;
            parameters[55].Value = ms.ASSET_A1_500;
            parameters[56].Value = ms.ASSET_A1_510;
            parameters[57].Value = ms.ASSET_A1_520;
            parameters[58].Value = ms.ASSET_A1_530;
            parameters[59].Value = ms.ASSET_A1_540;
            parameters[60].Value = ms.ASSET_A1_550;
            parameters[61].Value = ms.ASSET_A1_560;
            parameters[62].Value = ms.ASSET_A1_570;
            parameters[63].Value = ms.ASSET_A1_580;
            parameters[64].Value = ms.ASSET_A1_590;
            parameters[65].Value = ms.ASSET_A1_600;
            parameters[66].Value = ms.ASSET_A1_610;
            parameters[67].Value = ms.ASSET_A1_620;
            parameters[68].Value = ms.ASSET_A1_630;
            parameters[69].Value = ms.ASSET_A1_640;
            parameters[70].Value = ms.ASSET_A1_650;
            parameters[71].Value = ms.ASSET_A1_660;
            parameters[72].Value = ms.ASSET_A1_670;
            parameters[73].Value = ms.ASSET_A1_680;
            parameters[74].Value = ms.ASSET_A1_690;
            parameters[75].Value = ms.ASSET_A1_700;
            parameters[76].Value = ms.ASSET_A1_710;
            parameters[77].Value = ms.ASSET_A1_720;
            parameters[78].Value = ms.ASSET_A1_730;
            parameters[79].Value = ms.ASSET_A1_740;
            parameters[80].Value = ms.ASSET_A1_750;
            parameters[81].Value = ms.ASSET_A1_760;
            parameters[82].Value = ms.ASSET_A1_770;
            parameters[83].Value = ms.ASSET_A1_780;
            parameters[84].Value = ms.ASSET_A1_790;
            parameters[85].Value = ms.ASSET_A1_800;
            lstCmdText.Add(sb.ToString());
            sb.Remove(0, sb.ToString().Length);
            try
            {
                int iexe = DbHelperMySQL.ExecuteSql(lstCmdText[0].ToString(), parameters);
                if (iexe > 0)
                {
                    msr.strMsId = newRateId.ToString();
                    msr.strMS = "保存成功!";
                }
                else
                {
                    msr.strMsId = "-1";
                    msr.strMS = "操作失败:服务器忙,请稍后再试!";
                }
            }
            catch
            {
                msr.strMsId = "-1";
                msr.strMS = "操作失败:服务器忙,请稍后再试!";
            }
            lstCmdText = null;
            sb = null;
            return msr;
        }

        /// <summary>
        ///  更新asset_a1信息
        /// </summary>
        /// <param name="ms">实体信息 通过ASSET_A1_AUTOID进行判断有ASSET_A1_AUTOID就是update</param>
        /// <returns>消息</returns>
        public MsReturned Upasset_a1(Msasset_a1 ms)
        {
            List<string> lstResult = new List<string>();
            StringBuilder sb = new StringBuilder();
            List<string> lstCmdText = new List<string>();
            MsReturned msr = new MsReturned();
            sb.Append("update asset_a1 set ");
            sb.Append(" ASSET_A1_AUTOID='").Append(ms.ASSET_A1_AUTOID).Append("' ");// ASSET_A1_AUTOID AutoID
            if (ms.ASSET_A1_ISDEL != null && ms.ASSET_A1_ISDEL.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_ISDEL='").Append(ms.ASSET_A1_ISDEL).Append("' ");// ASSET_A1_ISDEL 是否删除
            }
            if (ms.ASSET_A1_MAKETIME != null && ms.ASSET_A1_MAKETIME.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_MAKETIME='").Append(ms.ASSET_A1_MAKETIME).Append("' ");// ASSET_A1_MAKETIME 新增时间
            }
            if (ms.ASSET_A1_MAKEUSER != null && ms.ASSET_A1_MAKEUSER.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_MAKEUSER='").Append(ms.ASSET_A1_MAKEUSER).Append("' ");// ASSET_A1_MAKEUSER 新增人
            }
            if (ms.ASSET_A1_PARENTID != null && ms.ASSET_A1_PARENTID.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_PARENTID='").Append(ms.ASSET_A1_PARENTID).Append("' ");// ASSET_A1_PARENTID 上级ID
            }
            if (ms.ASSET_A1_MAKEFROM != null && ms.ASSET_A1_MAKEFROM.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_MAKEFROM='").Append(ms.ASSET_A1_MAKEFROM).Append("' ");// ASSET_A1_MAKEFROM 来源
            }
            if (ms.ASSET_A1_10 != null && ms.ASSET_A1_10.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_10='").Append(ms.ASSET_A1_10).Append("' ");// ASSET_A1_10 数量
            }
            if (ms.ASSET_A1_20 != null && ms.ASSET_A1_20.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_20='").Append(ms.ASSET_A1_20).Append("' ");// ASSET_A1_20 资产名称
            }
            if (ms.ASSET_A1_30 != null && ms.ASSET_A1_30.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_30='").Append(ms.ASSET_A1_30).Append("' ");// ASSET_A1_30 资产编号
            }
            if (ms.ASSET_A1_40 != null && ms.ASSET_A1_40.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_40='").Append(ms.ASSET_A1_40).Append("' ");// ASSET_A1_40 出厂编号
            }
            if (ms.ASSET_A1_50 != null && ms.ASSET_A1_50.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_50='").Append(ms.ASSET_A1_50).Append("' ");// ASSET_A1_50 计财编号
            }
            if (ms.ASSET_A1_60 != null && ms.ASSET_A1_60.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_60='").Append(ms.ASSET_A1_60).Append("' ");// ASSET_A1_60 60 资产类别 
            }
            if (ms.ASSET_A1_70 != null && ms.ASSET_A1_70.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_70='").Append(ms.ASSET_A1_70).Append("' ");// ASSET_A1_70 是否扩容资产
            }
            if (ms.ASSET_A1_80 != null && ms.ASSET_A1_80.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_80='").Append(ms.ASSET_A1_80).Append("' ");// ASSET_A1_80 计量单位名称
            }
            if (ms.ASSET_A1_90 != null && ms.ASSET_A1_90.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_90='").Append(ms.ASSET_A1_90).Append("' ");// ASSET_A1_90 计量单位
            }
            if (ms.ASSET_A1_100 != null && ms.ASSET_A1_100.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_100='").Append(ms.ASSET_A1_100).Append("' ");// ASSET_A1_100 存放地点ID
            }
            if (ms.ASSET_A1_110 != null && ms.ASSET_A1_110.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_110='").Append(ms.ASSET_A1_110).Append("' ");// ASSET_A1_110 存放地点
            }
            if (ms.ASSET_A1_120 != null && ms.ASSET_A1_120.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_120='").Append(ms.ASSET_A1_120).Append("' ");// ASSET_A1_120 资产原值
            }
            if (ms.ASSET_A1_130 != null && ms.ASSET_A1_130.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_130='").Append(ms.ASSET_A1_130).Append("' ");// ASSET_A1_130 原值说明
            }
            if (ms.ASSET_A1_140 != null && ms.ASSET_A1_140.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_140='").Append(ms.ASSET_A1_140).Append("' ");// ASSET_A1_140 供应商ID
            }
            if (ms.ASSET_A1_150 != null && ms.ASSET_A1_150.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_150='").Append(ms.ASSET_A1_150).Append("' ");// ASSET_A1_150 供应商
            }
            if (ms.ASSET_A1_160 != null && ms.ASSET_A1_160.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_160='").Append(ms.ASSET_A1_160).Append("' ");// ASSET_A1_160 品牌ID
            }
            if (ms.ASSET_A1_170 != null && ms.ASSET_A1_170.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_170='").Append(ms.ASSET_A1_170).Append("' ");// ASSET_A1_170 品牌
            }
            if (ms.ASSET_A1_180 != null && ms.ASSET_A1_180.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_180='").Append(ms.ASSET_A1_180).Append("' ");// ASSET_A1_180 型号ID
            }
            if (ms.ASSET_A1_190 != null && ms.ASSET_A1_190.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_190='").Append(ms.ASSET_A1_190).Append("' ");// ASSET_A1_190 型号
            }
            if (ms.ASSET_A1_200 != null && ms.ASSET_A1_200.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_200='").Append(ms.ASSET_A1_200).Append("' ");// ASSET_A1_200 使用人员ID
            }
            if (ms.ASSET_A1_210 != null && ms.ASSET_A1_210.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_210='").Append(ms.ASSET_A1_210).Append("' ");// ASSET_A1_210 使用人员
            }
            if (ms.ASSET_A1_220 != null && ms.ASSET_A1_220.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_220='").Append(ms.ASSET_A1_220).Append("' ");// ASSET_A1_220 使用部门ID
            }
            if (ms.ASSET_A1_230 != null && ms.ASSET_A1_230.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_230='").Append(ms.ASSET_A1_230).Append("' ");// ASSET_A1_230 使用部门
            }
            if (ms.ASSET_A1_240 != null && ms.ASSET_A1_240.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_240='").Append(ms.ASSET_A1_240).Append("' ");// ASSET_A1_240 盘点次数
            }
            if (ms.ASSET_A1_250 != null && ms.ASSET_A1_250.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_250='").Append(ms.ASSET_A1_250).Append("' ");// ASSET_A1_250 打印次数
            }
            if (ms.ASSET_A1_260 != null && ms.ASSET_A1_260.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_260='").Append(ms.ASSET_A1_260).Append("' ");// ASSET_A1_260 是否打印标签
            }
            if (ms.ASSET_A1_270 != null && ms.ASSET_A1_270.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_270='").Append(ms.ASSET_A1_270).Append("' ");// ASSET_A1_270 是否盘点
            }
            if (ms.ASSET_A1_280 != null && ms.ASSET_A1_280.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_280='").Append(ms.ASSET_A1_280).Append("' ");// ASSET_A1_280 库存状态
            }
            if (ms.ASSET_A1_290 != null && ms.ASSET_A1_290.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_290='").Append(ms.ASSET_A1_290).Append("' ");// ASSET_A1_290 报废状态
            }
            if (ms.ASSET_A1_300 != null && ms.ASSET_A1_300.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_300='").Append(ms.ASSET_A1_300).Append("' ");// ASSET_A1_300 使用状态
            }
            if (ms.ASSET_A1_310 != null && ms.ASSET_A1_310.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_310='").Append(ms.ASSET_A1_310).Append("' ");// ASSET_A1_310 维修状态
            }
            if (ms.ASSET_A1_320 != null && ms.ASSET_A1_320.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_320='").Append(ms.ASSET_A1_320).Append("' ");// ASSET_A1_320 调拨状态
            }
            if (ms.ASSET_A1_330 != null && ms.ASSET_A1_330.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_330='").Append(ms.ASSET_A1_330).Append("' ");// ASSET_A1_330 领用状态
            }
            if (ms.ASSET_A1_340 != null && ms.ASSET_A1_340.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_340='").Append(ms.ASSET_A1_340).Append("' ");// ASSET_A1_340 盘点状态
            }
            if (ms.ASSET_A1_350 != null && ms.ASSET_A1_350.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_350='").Append(ms.ASSET_A1_350).Append("' ");// ASSET_A1_350 资产用途
            }
            if (ms.ASSET_A1_360 != null && ms.ASSET_A1_360.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_360='").Append(ms.ASSET_A1_360).Append("' ");// ASSET_A1_360 生产厂家
            }
            if (ms.ASSET_A1_370 != null && ms.ASSET_A1_370.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_370='").Append(ms.ASSET_A1_370).Append("' ");// ASSET_A1_370 使用年限
            }
            if (ms.ASSET_A1_380 != null && ms.ASSET_A1_380.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_380='").Append(ms.ASSET_A1_380).Append("' ");// ASSET_A1_380 已使用年限
            }
            if (ms.ASSET_A1_390 != null && ms.ASSET_A1_390.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_390='").Append(ms.ASSET_A1_390).Append("' ");// ASSET_A1_390 备用1
            }
            if (ms.ASSET_A1_400 != null && ms.ASSET_A1_400.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_400='").Append(ms.ASSET_A1_400).Append("' ");// ASSET_A1_400 备用2
            }
            if (ms.ASSET_A1_410 != null && ms.ASSET_A1_410.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_410='").Append(ms.ASSET_A1_410).Append("' ");// ASSET_A1_410 备用3
            }
            if (ms.ASSET_A1_420 != null && ms.ASSET_A1_420.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_420='").Append(ms.ASSET_A1_420).Append("' ");// ASSET_A1_420 
            }
            if (ms.ASSET_A1_430 != null && ms.ASSET_A1_430.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_430='").Append(ms.ASSET_A1_430).Append("' ");// ASSET_A1_430 
            }
            if (ms.ASSET_A1_440 != null && ms.ASSET_A1_440.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_440='").Append(ms.ASSET_A1_440).Append("' ");// ASSET_A1_440 
            }
            if (ms.ASSET_A1_450 != null && ms.ASSET_A1_450.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_450='").Append(ms.ASSET_A1_450).Append("' ");// ASSET_A1_450 
            }
            if (ms.ASSET_A1_460 != null && ms.ASSET_A1_460.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_460='").Append(ms.ASSET_A1_460).Append("' ");// ASSET_A1_460 
            }
            if (ms.ASSET_A1_470 != null && ms.ASSET_A1_470.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_470='").Append(ms.ASSET_A1_470).Append("' ");// ASSET_A1_470 
            }
            if (ms.ASSET_A1_480 != null && ms.ASSET_A1_480.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_480='").Append(ms.ASSET_A1_480).Append("' ");// ASSET_A1_480 
            }
            if (ms.ASSET_A1_490 != null && ms.ASSET_A1_490.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_490='").Append(ms.ASSET_A1_490).Append("' ");// ASSET_A1_490 
            }
            if (ms.ASSET_A1_500 != null && ms.ASSET_A1_500.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_500='").Append(ms.ASSET_A1_500).Append("' ");// ASSET_A1_500 
            }
            if (ms.ASSET_A1_510 != null && ms.ASSET_A1_510.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_510='").Append(ms.ASSET_A1_510).Append("' ");// ASSET_A1_510 
            }
            if (ms.ASSET_A1_520 != null && ms.ASSET_A1_520.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_520='").Append(ms.ASSET_A1_520).Append("' ");// ASSET_A1_520 
            }
            if (ms.ASSET_A1_530 != null && ms.ASSET_A1_530.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_530='").Append(ms.ASSET_A1_530).Append("' ");// ASSET_A1_530 
            }
            if (ms.ASSET_A1_540 != null && ms.ASSET_A1_540.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_540='").Append(ms.ASSET_A1_540).Append("' ");// ASSET_A1_540 
            }
            if (ms.ASSET_A1_550 != null && ms.ASSET_A1_550.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_550='").Append(ms.ASSET_A1_550).Append("' ");// ASSET_A1_550 
            }
            if (ms.ASSET_A1_560 != null && ms.ASSET_A1_560.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_560='").Append(ms.ASSET_A1_560).Append("' ");// ASSET_A1_560 
            }
            if (ms.ASSET_A1_570 != null && ms.ASSET_A1_570.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_570='").Append(ms.ASSET_A1_570).Append("' ");// ASSET_A1_570 
            }
            if (ms.ASSET_A1_580 != null && ms.ASSET_A1_580.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_580='").Append(ms.ASSET_A1_580).Append("' ");// ASSET_A1_580 
            }
            if (ms.ASSET_A1_590 != null && ms.ASSET_A1_590.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_590='").Append(ms.ASSET_A1_590).Append("' ");// ASSET_A1_590 
            }
            if (ms.ASSET_A1_600 != null && ms.ASSET_A1_600.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_600='").Append(ms.ASSET_A1_600).Append("' ");// ASSET_A1_600 
            }
            if (ms.ASSET_A1_610 != null && ms.ASSET_A1_610.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_610='").Append(ms.ASSET_A1_610).Append("' ");// ASSET_A1_610 
            }
            if (ms.ASSET_A1_620 != null && ms.ASSET_A1_620.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_620='").Append(ms.ASSET_A1_620).Append("' ");// ASSET_A1_620 
            }
            if (ms.ASSET_A1_630 != null && ms.ASSET_A1_630.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_630='").Append(ms.ASSET_A1_630).Append("' ");// ASSET_A1_630 
            }
            if (ms.ASSET_A1_640 != null && ms.ASSET_A1_640.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_640='").Append(ms.ASSET_A1_640).Append("' ");// ASSET_A1_640 
            }
            if (ms.ASSET_A1_650 != null && ms.ASSET_A1_650.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_650='").Append(ms.ASSET_A1_650).Append("' ");// ASSET_A1_650 
            }
            if (ms.ASSET_A1_660 != null && ms.ASSET_A1_660.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_660='").Append(ms.ASSET_A1_660).Append("' ");// ASSET_A1_660 
            }
            if (ms.ASSET_A1_670 != null && ms.ASSET_A1_670.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_670='").Append(ms.ASSET_A1_670).Append("' ");// ASSET_A1_670 
            }
            if (ms.ASSET_A1_680 != null && ms.ASSET_A1_680.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_680='").Append(ms.ASSET_A1_680).Append("' ");// ASSET_A1_680 
            }
            if (ms.ASSET_A1_690 != null && ms.ASSET_A1_690.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_690='").Append(ms.ASSET_A1_690).Append("' ");// ASSET_A1_690 
            }
            if (ms.ASSET_A1_700 != null && ms.ASSET_A1_700.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_700='").Append(ms.ASSET_A1_700).Append("' ");// ASSET_A1_700 
            }
            if (ms.ASSET_A1_710 != null && ms.ASSET_A1_710.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_710='").Append(ms.ASSET_A1_710).Append("' ");// ASSET_A1_710 
            }
            if (ms.ASSET_A1_720 != null && ms.ASSET_A1_720.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_720='").Append(ms.ASSET_A1_720).Append("' ");// ASSET_A1_720 
            }
            if (ms.ASSET_A1_730 != null && ms.ASSET_A1_730.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_730='").Append(ms.ASSET_A1_730).Append("' ");// ASSET_A1_730 
            }
            if (ms.ASSET_A1_740 != null && ms.ASSET_A1_740.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_740='").Append(ms.ASSET_A1_740).Append("' ");// ASSET_A1_740 
            }
            if (ms.ASSET_A1_750 != null && ms.ASSET_A1_750.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_750='").Append(ms.ASSET_A1_750).Append("' ");// ASSET_A1_750 
            }
            if (ms.ASSET_A1_760 != null && ms.ASSET_A1_760.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_760='").Append(ms.ASSET_A1_760).Append("' ");// ASSET_A1_760 
            }
            if (ms.ASSET_A1_770 != null && ms.ASSET_A1_770.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_770='").Append(ms.ASSET_A1_770).Append("' ");// ASSET_A1_770 
            }
            if (ms.ASSET_A1_780 != null && ms.ASSET_A1_780.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_780='").Append(ms.ASSET_A1_780).Append("' ");// ASSET_A1_780 
            }
            if (ms.ASSET_A1_790 != null && ms.ASSET_A1_790.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_790='").Append(ms.ASSET_A1_790).Append("' ");// ASSET_A1_790 
            }
            if (ms.ASSET_A1_800 != null && ms.ASSET_A1_800.ToString() != "")
            {
                sb.Append(",").Append(" ASSET_A1_800='").Append(ms.ASSET_A1_800).Append("' ");// ASSET_A1_800 
            }
            sb.Append(" where ASSET_A1_AUTOID='").Append(ms.ASSET_A1_AUTOID).Append("'");// ASSET_A1_AUTOID AutoID
            lstCmdText.Add(sb.ToString());
            sb.Remove(0, sb.ToString().Length);
            try
            {
                int iexe = DbHelperMySQL.ExecuteSql(lstCmdText[0].ToString());
                if (iexe > 0)
                {
                    msr.strMsId = ms.ASSET_A1_AUTOID.ToString();
                    msr.strMS = "保存成功!";
                }
                else
                {
                    msr.strMsId = "-1";
                    msr.strMS = "操作失败:服务器忙,请稍后再试!";
                }
            }
            catch
            {
                msr.strMsId = "-1";
                msr.strMS = "操作失败:服务器忙,请稍后再试!";
            }
            lstCmdText = null;
            sb = null;
            return msr;
        }

        /// <summary>
        /// 得到数据类型
        /// </summary>
        /// <param name="msq">条件</param>
        /// <returns>数据类型</returns>
        public MsReturned Getasset_a1ByQuery(MsQuery msq)
        {
            DataSet ds = null;
            MsReturned msr = new MsReturned();
            StringBuilder sb = new StringBuilder();
            List<string> lstCmdText = new List<string>();
            sb.Append("select asset_a1.* ");
            sb.Append(" from asset_a1 ");
            sb.Append(" where 1=1 ").Append(msq.strquery);
            if (msq.strorder != null && msq.strorder != "")
            {
                sb.Append(" order by ").Append(msq.strorder);
            }
            lstCmdText.Add(sb.ToString());
            sb.Remove(0, sb.ToString().Length);
            try
            {
                ds = DbHelperMySQL.Query(lstCmdText[0].ToString());
            }
            catch { }
            msr.data = ds;
            return msr;
        }

        /// <summary>
        /// 删除asset_a1
        /// </summary>
        /// <param name="msq">条件</param>
        /// <returns></returns>
        public MsReturned Deleteasset_a1ByQuery(MsQuery msq)
        {
            StringBuilder sb = new StringBuilder();
            MsReturned msr = new MsReturned();
            sb.Append(" delete from asset_a1 where ASSET_A1_AUTOID > 0 ").Append(msq.strquery);
            try
            {
                int iexe = DbHelperMySQL.ExecuteSql(sb.ToString());
                if (iexe > 0)
                {
                    msr.strMsId = "1";
                    msr.strMS = "保存成功!";
                }
                else
                {
                    msr.strMsId = "-1";
                    msr.strMS = "操作失败:服务器忙,请稍后再试!";
                }
            }
            catch
            {
                msr.strMsId = "-1";
                msr.strMS = "操作失败:服务器忙,请稍后再试!";
            }
            sb = null;
            return msr;
        }

    }
}
